<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>海事网上政务大厅</title>

	<link rel="stylesheet" type="text/css" href="../../../css/cloud-admin.css" >
		
		
	<!-- 上传控件 -->
	<link href="../../../js/fileupload/css/fileinput.css" media="all" rel="stylesheet" type="text/css"/>
    <link href="../../../js/fileupload/css/font-awesome.min.css" media="all" rel="stylesheet" type="text/css"/>
	<link href="../../../js/fileupload/themes/explorer-fa/theme.css" media="all" rel="stylesheet" type="text/css"/>	
	
	<!--jquery -->
	
	<script type="text/javascript" src="../../../summernote/jquery.js" ></script>

	<script src="../../../js/fileupload/js/plugins/sortable.js" type="text/javascript"></script>
	<script src="../../../js/fileupload/js/fileinput.js" type="text/javascript"></script>
	<script src="../../../js/fileupload/js/locales/zh.js" type="text/javascript"></script>
	<script src="../../../js/fileupload/themes/explorer-fa/theme.js" type="text/javascript"></script>


	
	<!-- BOOTSTRAP -->
	<script src="../../../bootstrap-dist/js/bootstrap.min.js"></script>
	

	<!-- jquery-confirm -->
	<link href="../../../css/jquery-confirm.min.css" rel="stylesheet">
	<script type="text/javascript" src="../../../js/jquery-confirm.min.js" ></script>
	
	
	<!-- xcConfirm -->
	<link rel="stylesheet" type="text/css" href="../../../css/xcConfirm.css"/>
	<script src="../../../js/xcConfirm.js" type="text/javascript" charset="utf-8"></script>
	
	
	<script type="text/javascript" src="../../../js/share.js"></script>
	
	
	<style type="text/css">
		.tdTitle{
			background-color: #eee; width:13%; text-align: right;
		}
		.tdContent{
			width:20.3%;
		}
	</style>
	<script type="text/javascript">
		var jointlysign;
		var instanceid;
		var flowtaskid;
		var applyid;
		var taskuserid;
		var applyno;
		var itemname;
		var pinstanceid;
		var orgname;
		var taskname;
		
		$(function(){
			setModalSize();
			jointlysign=getUrlParamDecode("jointlysign");
			applyno = getUrlParamDecode("applyno");
			console.log(applyno);
			instanceid = getUrlParamDecode("instanceid");
			flowtaskid = getUrlParamDecode("flowtaskid");
			applyid= getUrlParamDecode("applyid");
			taskuserid=getUrlParamDecode("taskuserid");
			applyno= getUrlParamDecode("applyno");
			itemname=getUrlParamDecode("itemname");
			pinstanceid=getUrlParamDecode("pinstanceid");
			orgname=getUrlParamDecode("orgname");
			taskname=getUrlParamDecode("taskname");
			jumpTask();
			$('#save').click(function(){
				$("#ifModal")[0].contentWindow.save();
			});
		});

		function setModalSize(){
			var documentW = $(window).width();
			var documentH = $(window).height();
			$('#modalW').width("100%");
			$('#modalH').height(documentH * 1);	
		}
		function jumpTask(){
			$('#modalTile').html(applyno + ' - ' + itemname + ' - ' + orgname + ' - ' + taskname);
			$("#modal").modal('show');
			$.ajax({ 
				method: 'post',
				url: basePath() + 'flow/selecttaskuser.do',
				data: JSON.stringify({"taskuserid":taskuserid}),
				async: false,
				dataType: "json",
		        contentType: "application/json",
				success: function(data){
			    	if(data.taskuserstate == "1"){
			    		if(jointlysign!=undefined&&jointlysign!=''&&jointlysign=="1"){
							$('#ifModal').attr("src", "../../query/detail.html?applyno=" + applyno + '&instanceid=' + pinstanceid);
			    		}else{
							$('#ifModal').attr("src", "../../query/detail.html?applyno=" + applyno + '&instanceid=' + instanceid);
			    		}
			    	} 
			    	else{
			    		if(jointlysign!=undefined&&jointlysign!=''&&jointlysign=="1"){
							$('#ifModal').attr("src", "jointlysignaccept.html?applyno=" + applyno + '&instanceid=' + instanceid + '&flowtaskid=' + flowtaskid+ '&applyid=' + applyid+ '&pinstanceid=' + pinstanceid+ '&taskuserid=' + taskuserid+ '&itemname=' + itemname);
						}else{
							$('#ifModal').attr("src", "accept.html?applyno=" + applyno + '&instanceid=' + instanceid + '&flowtaskid=' + flowtaskid+ '&applyid=' + applyid+ '&pinstanceid=' + pinstanceid+ '&taskuserid=' + taskuserid+ '&itemname=' + itemname);
						}
			    	}
		      	}
			});
		}
		
	</script>
</head>
<body style="background-color: white;">
	<div class="modal fade" id="modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog" id="modalW" style="margin:0">
			<div class="modal-content">
				<div class="modal-header modal-primary">
					<h4 class="modal-title" id="myModalLabel" style="font-weight: 900;">
						<span id="modalTile">标题</span>
						<button type="button" class="btn btn-primary pull-right" style="width: 100px;" id="save">提交</button>
					</h4>
					
				</div>
				<div class="modal-body" id="modalH">
					<iframe id="ifModal" name="ifModal" frameborder="0" marginheight="0" marginwidth="0" scrolling="yes" style="width: 100%; height: 100%"></iframe>									
				</div>
				<div class="modal-footer">
					
				</div>
			</div>
		</div>								
	</div>
</body>
</html>